package com.gitee.leijin.rbac.util;


import cn.hutool.core.convert.Convert;

import java.util.List;

public class ConvertUtils {

    /**
     * 转换单个对象
     * @param source
     * @param targetClass
     * @return
     * @param <T>
     */
    public static <T> T convert(Object source, Class<T> targetClass) {
        return Convert.convert(targetClass, source);
    }

    /**
     * 转换List
     * @param source
     * @param targetClass
     * @return
     * @param <T>
     */
    public static <T> List<T> convertList(List<?> source, Class<T> targetClass) {
        return Convert.toList(targetClass, source);
    }
}
